<template>
    <!-- 分包商查看页面 -->
    <div class="e-form">
        <div class="tabs">
            <el-tabs
                tab-position="left"
                v-model="tabsName"
                @tab-click="onChangeTab"
            >
                <!-- 基本信息 -->
                <el-tab-pane
                    label="基本信息"
                    name="baseInfo"
                    :disabled="clickTabFlag"
                ></el-tab-pane>
                <el-tab-pane
                    label="资质信息"
                    name="aptitude"
                    :disabled="clickTabFlag"
                ></el-tab-pane>
                <el-tab-pane
                    label="企业主要业绩"
                    name="firmPerformance"
                    :disabled="clickTabFlag"
                ></el-tab-pane>
                <el-tab-pane
                    label="企业主要管理人"
                    name="firmAdmin"
                    :disabled="clickTabFlag"
                ></el-tab-pane>
                <el-tab-pane
                    label="附件信息"
                    name="accessory"
                    :disabled="clickTabFlag"
                ></el-tab-pane>
                <el-tab-pane
                    label="审核历史"
                    name="auditHistory"
                    :disabled="clickTabFlag"
                ></el-tab-pane>
                <el-tab-pane
                    label="变更历史"
                    name="alteration"
                    :disabled="clickTabFlag"
                ></el-tab-pane>

                <el-tab-pane
                    label="评价历史"
                    name="evaluate"
                    :disabled="clickTabFlag"
                ></el-tab-pane>
                <div>
                    <!-- 基本信息 -->
                    <div id="baseInfoCon" class="con">
                        <div class="e-form">
                            <div class="tabs">
                                <div class="tabs-title" id="baseInfo">
                                    基本信息
                                </div>
                                <div
                                    style="margin: 0px 0px 10px 25px"
                                    class="expirationPrompt"
                                    v-if="expirationPrompt.length > 0"
                                >
                                    <span
                                        style="display: block; color: red"
                                        v-for="(
                                            item, index
                                        ) in expirationPrompt"
                                        :key="index"
                                    >
                                        {{ item }}
                                    </span>
                                </div>
                                <div style="width: 100%" class="form">
                                    <el-form
                                        :model="basicFormData"
                                        label-width="150px"
                                    >
                                        <BillTop
                                            title="分包商详情"
                                            @cancel="handleClose"
                                        ></BillTop>
                                        <el-row>
                                            <el-col :span="12">
                                                <el-form-item
                                                    label="统一社会信用代码"
                                                >
                                                    {{
                                                        basicFormData.creditCode
                                                    }}
                                                </el-form-item>
                                            </el-col>
                                            <el-col :span="12">
                                                <el-form-item
                                                    label="分包商名称"
                                                >
                                                    {{
                                                        basicFormData.subcontractorName
                                                    }}
                                                </el-form-item>
                                            </el-col>
                                        </el-row>
                                        <el-row>
                                            <el-col :span="12">
                                                <el-form-item label="类型">
                                                    {{ basicFormData.type }}
                                                </el-form-item>
                                            </el-col>
                                            <el-col :span="12">
                                                <el-form-item label="法人代表">
                                                    {{ basicFormData.deputy }}
                                                </el-form-item>
                                            </el-col>
                                        </el-row>
                                        <el-row>
                                            <el-form-item label="注册地址">
                                                {{
                                                    showAddress(
                                                        basicFormData.addressDetail
                                                    )
                                                }}
                                            </el-form-item>
                                        </el-row>
                                        <el-row>
                                            <el-col :span="12">
                                                <el-form-item label="联系电话">
                                                    {{
                                                        basicFormData.contactTel
                                                    }}
                                                </el-form-item>
                                            </el-col>
                                            <el-col :span="12">
                                                <el-form-item
                                                    label="注册资本（万元）"
                                                >
                                                    {{
                                                        basicFormData.registerCapital
                                                    }}
                                                </el-form-item>
                                            </el-col>
                                        </el-row>
                                        <el-row>
                                            <el-col :span="12">
                                                <el-form-item label="传真">
                                                    {{ basicFormData.fax }}
                                                </el-form-item>
                                            </el-col>
                                            <el-col :span="12">
                                                <el-form-item label="邮箱">
                                                    {{ basicFormData.email }}
                                                </el-form-item>
                                            </el-col>
                                        </el-row>
                                        <el-row>
                                            <el-col :span="12">
                                                <el-form-item label="纳税类别">
                                                    {{ basicFormData.taxType }}
                                                </el-form-item>
                                            </el-col>
                                            <el-col :span="12">
                                                <el-form-item label="邮编">
                                                    {{ basicFormData.postCode }}
                                                </el-form-item>
                                            </el-col>
                                        </el-row>
                                        <el-row>
                                            <el-col :span="12">
                                                <el-form-item
                                                    label="增值税一般纳税人资格查询"
                                                    ><a
                                                        href="https://etax.sichuan.chinatax.gov.cn/"
                                                        target="_blank"
                                                        >查询</a
                                                    >
                                                </el-form-item>
                                            </el-col>
                                            <el-col :span="12">
                                                <el-form-item
                                                    label="四川住房城乡建设厅信息查询"
                                                >
                                                    <a
                                                        href="http://202.61.88.188/xxgx/index.aspx"
                                                        target="_blank"
                                                        >查询</a
                                                    ></el-form-item
                                                >
                                            </el-col>
                                        </el-row>
                                        <el-row>
                                            <el-col :span="12">
                                                <el-form-item
                                                    label="信用信息查询"
                                                >
                                                    <a
                                                        href="http://www.gsxt.gov.cn/index.html"
                                                        target="_blank"
                                                        >查询</a
                                                    >
                                                </el-form-item>
                                            </el-col>
                                            <el-col :span="12">
                                                <el-form-item label="管理单位">
                                                    {{
                                                        basicFormData.manageOrgName
                                                    }}
                                                </el-form-item>
                                            </el-col>
                                        </el-row>
                                        <el-row>
                                            <el-col :span="12">
                                                <el-form-item
                                                    label="是否为境外单位"
                                                >
                                                    <span
                                                        v-if="
                                                            basicFormData.isAbroadUnit ==
                                                            1
                                                        "
                                                    >
                                                        {{ '是' }}
                                                    </span>
                                                    <span
                                                        v-if="
                                                            basicFormData.isAbroadUnit ==
                                                            0
                                                        "
                                                    >
                                                        {{ '否' }}
                                                    </span>
                                                </el-form-item>
                                            </el-col>
                                            <el-col :span="12">
                                                <el-form-item label="录入人">
                                                    {{
                                                        basicFormData.founderName
                                                    }}
                                                </el-form-item>
                                            </el-col>
                                        </el-row>
                                        <el-row>
                                            <el-col :span="12">
                                                <el-form-item label="信用等级">
                                                    <span>
                                                        {{
                                                            basicFormData.creditLevel ==
                                                            '0'
                                                                ? '待定'
                                                                : basicFormData.creditLevel ==
                                                                  '1'
                                                                ? 'A'
                                                                : basicFormData.creditLevel ==
                                                                  '2'
                                                                ? 'B'
                                                                : basicFormData.creditLevel ==
                                                                  '3'
                                                                ? 'C'
                                                                : basicFormData.creditLevel ==
                                                                  '4'
                                                                ? 'D'
                                                                : basicFormData.creditLevel ==
                                                                  '5'
                                                                ? 'S'
                                                                : ''
                                                        }}</span
                                                    >
                                                </el-form-item>
                                            </el-col>
                                            <el-col :span="12">
                                                <el-form-item label="状态：">
                                                    {{
                                                        statusLable(
                                                            basicFormData.state
                                                        )
                                                    }}
                                                </el-form-item>
                                            </el-col>
                                        </el-row>
                                        <el-row
                                            v-if="
                                                basicFormData.isAbroadUnit == 0
                                            "
                                        >
                                            <el-form-item label="固定工作地址">
                                                <span>
                                                    {{
                                                        showAddress(
                                                            basicFormData.fixAddressDetail
                                                        )
                                                    }}
                                                </span>
                                            </el-form-item>
                                        </el-row>
                                        <el-row
                                            v-if="
                                                basicFormData.isAbroadUnit == 0
                                            "
                                        >
                                            <el-form-item label="企业基本情况">
                                                {{ basicFormData.basicInfo }}
                                            </el-form-item>
                                        </el-row>
                                        <el-row
                                            v-if="
                                                basicFormData.isAbroadUnit == 0
                                            "
                                        >
                                            <el-col :span="12">
                                                <el-form-item
                                                    label="企业注册建造师数量"
                                                >
                                                    {{
                                                        basicFormData.registeredConstructorQty
                                                    }}
                                                </el-form-item>
                                            </el-col>

                                            <el-col :span="12">
                                                <el-form-item
                                                    label="中级及以上职称人员数量"
                                                >
                                                    {{
                                                        basicFormData.aboveTitleQty
                                                    }}
                                                </el-form-item>
                                            </el-col>
                                        </el-row>
                                        <el-row
                                            v-if="
                                                basicFormData.isAbroadUnit == 0
                                            "
                                        >
                                            <el-col :span="12">
                                                <el-form-item
                                                    label="持有岗位证书的施工现场管理人员数量"
                                                >
                                                    {{
                                                        basicFormData.certificateQty
                                                    }}
                                                </el-form-item>
                                            </el-col>

                                            <el-col :span="12">
                                                <el-form-item
                                                    label="持有安全C证人员数量"
                                                >
                                                    {{
                                                        basicFormData.safetyCertificateQty
                                                    }}
                                                </el-form-item>
                                            </el-col>
                                        </el-row>
                                        <el-row
                                            v-if="
                                                basicFormData.isAbroadUnit == 0
                                            "
                                        >
                                            <el-col :span="12">
                                                <el-form-item
                                                    label="正常缴纳社保人数"
                                                >
                                                    {{
                                                        basicFormData.paySocialSecurityQty
                                                    }}
                                                </el-form-item>
                                            </el-col>

                                            <el-col :span="12">
                                                <el-form-item
                                                    label="经考级或培训合格的中级工以上技术工人数量"
                                                >
                                                    {{
                                                        basicFormData.passedTrainingQty
                                                    }}
                                                </el-form-item>
                                            </el-col>
                                        </el-row>
                                    </el-form>
                                </div>
                            </div>
                        </div>

                        <!-- ------------------------------------------------------------------------------------- -->
                    </div>

                    <!-- 资质信息 -->
                    <div id="aptitudeCon" class="con">
                        <div class="tabs-title" id="aptitude">资质信息</div>
                        <div class="e-table">
                            <div class="top">
                                <div class="left">
                                    <div>
                                        <el-button
                                            size="small"
                                            style="
                                                background: #7aa818;
                                                color: #fff;
                                            "
                                            @click="
                                                attachDownload('aptitudeTable')
                                            "
                                            >批量下载</el-button
                                        >
                                    </div>
                                </div>
                            </div>
                            <el-table
                                :data="aptitudeTable"
                                border
                                ref="table"
                                style="width: 100%"
                                class="table"
                                :max-height="$store.state.tableHeight"
                                @cell-mouse-enter="cellMouseEnter"
                                @cell-mouse-leave="cellMouseLeave"
                                @select="selectAptitudeTable"
                                @select-all="selectAptitudeTableAll"
                                :cell-class-name="cellClsNm"
                                :header-cell-style="{ textAlign: 'center' }"
                                :cell-style="{ textAlign: 'center' }"
                                v-sortTable="{
                                    tableData: aptitudeTable,
                                    _this: this,
                                    ref: 'table'
                                }"
                            >
                                <el-table-column type="selection" width="55">
                                </el-table-column>
                                <el-table-column label="操作" width="55">
                                    <template slot-scope="{ row }">
                                        <img
                                            src="@/assets/btn/downLoad.png"
                                            @click="handleDownload(row, 1)"
                                            style="margin-right: 5px"
                                        />
                                    </template>
                                </el-table-column>
                                <el-table-column
                                    type="index"
                                    label="序号"
                                    width="55"
                                >
                                </el-table-column>
                                <el-table-column
                                    prop="certNo"
                                    label="证书编号"
                                    width="150"
                                >
                                </el-table-column>
                                <el-table-column
                                    prop="certTypeValue"
                                    label="证书类型"
                                    width="100"
                                >
                                </el-table-column>
                                <el-table-column
                                    prop="qualificationLevelName"
                                    label="主营范围/证书等级"
                                    min-width="200"
                                >
                                </el-table-column>
                                <el-table-column
                                    prop="startDate"
                                    label="有效期开始日期"
                                    width="150"
                                >
                                </el-table-column>
                                <el-table-column
                                    prop="endDate"
                                    label="有效期结束日期"
                                    width="150"
                                >
                                </el-table-column>
                                <el-table-column
                                    prop="fileName"
                                    label="文件名"
                                    min-width="150"
                                >
                                    <template slot-scope="scope">
                                        <span
                                            @click="preview(scope.row)"
                                            style="color: blue; cursor: pointer"
                                        >
                                            {{ scope.row.fileName }}
                                        </span>
                                    </template>
                                </el-table-column>
                                <el-table-column
                                    prop="fileSize"
                                    label="大小"
                                    width="100"
                                >
                                </el-table-column>
                                <el-table-column
                                    prop="gmtCreate"
                                    label="上传时间"
                                    width="100"
                                >
                                </el-table-column>
                                <el-table-column
                                    prop="founderName"
                                    label="上传人"
                                    width="100"
                                >
                                </el-table-column>
                            </el-table>
                        </div>
                    </div>

                    <!-- 企业主要业绩 -->
                    <div id="firmPerformanceCon" class="con">
                        <div class="tabs-title" id="firmPerformance">
                            企业主要业绩
                        </div>
                        <div class="e-table">
                            <div class="top">
                                <div class="left">
                                    <div>
                                        <el-button
                                            size="small"
                                            style="
                                                background: #7aa818;
                                                color: #fff;
                                            "
                                            @click="
                                                attachDownload(
                                                    'performanceData'
                                                )
                                            "
                                            >批量下载</el-button
                                        >
                                    </div>
                                </div>
                            </div>
                            <el-table
                                :data="performanceData"
                                border
                                style="width: 100%"
                                ref="table"
                                class="table"
                                :max-height="$store.state.tableHeight"
                                @cell-mouse-enter="cellMouseEnter"
                                @cell-mouse-leave="cellMouseLeave"
                                @select="selectPerformanceData"
                                @select-all="selectPerformanceDataAll"
                                :cell-class-name="cellClsNm"
                                :header-cell-style="{ textAlign: 'center' }"
                                :cell-style="{ textAlign: 'center' }"
                                v-sortTable="{
                                    tableData: performanceData,
                                    _this: this,
                                    ref: 'table'
                                }"
                            >
                                <el-table-column type="selection" width="55">
                                </el-table-column>
                                <el-table-column label="操作" width="55">
                                    <template slot-scope="{ row }">
                                        <img
                                            src="@/assets/btn/downLoad.png"
                                            @click="handleDownload(row, 2)"
                                            style="margin-right: 5px"
                                        />
                                    </template>
                                </el-table-column>
                                <el-table-column
                                    type="index"
                                    label="序号"
                                    width="100"
                                >
                                </el-table-column>
                                <el-table-column
                                    prop="contractName"
                                    label="合同名称"
                                    width="150"
                                >
                                </el-table-column>
                                <el-table-column
                                    prop="projectName"
                                    label="项目名称"
                                    width="150"
                                >
                                </el-table-column>
                                <el-table-column
                                    prop="contractAmount"
                                    label="合同金额"
                                    width="150"
                                >
                                </el-table-column>
                                <el-table-column
                                    prop="workContect"
                                    label="所承担工程内容"
                                    width="150"
                                >
                                </el-table-column>
                                <el-table-column
                                    prop="startDate"
                                    label="开工时间"
                                    width="150"
                                >
                                </el-table-column>
                                <el-table-column
                                    prop="endDate"
                                    label="竣工时间"
                                    width="150"
                                >
                                </el-table-column>
                                <el-table-column
                                    prop="projectLeader"
                                    label="项目负责人"
                                    width="150"
                                >
                                </el-table-column>
                                <el-table-column
                                    prop="witnessName"
                                    label="业绩证明人"
                                    width="150"
                                >
                                </el-table-column>
                                <el-table-column
                                    prop="witnessTel"
                                    label="证明人电话"
                                    width="150"
                                >
                                </el-table-column>
                                <el-table-column
                                    prop="opinion"
                                    label="质量安全信誉评价意见"
                                    width="200"
                                >
                                </el-table-column>
                                <el-table-column
                                    prop="fileName"
                                    label="附件"
                                    width="150"
                                >
                                    <template slot-scope="scope">
                                        <span
                                            @click="preview1(scope.row)"
                                            style="color: blue; cursor: pointer"
                                        >
                                            {{ scope.row.fileName }}
                                        </span>
                                    </template>
                                </el-table-column>
                                <el-table-column
                                    prop="contractTypeDesc"
                                    label="合同类型"
                                    width="150"
                                >
                                    <template slot-scope="{ row }">
                                        {{
                                            row.source == '1'
                                                ? '--'
                                                : options.subTypeForm[
                                                      row.contractType
                                                  ]
                                        }}
                                    </template>
                                </el-table-column>
                                <el-table-column
                                    prop="contractStateDesc"
                                    label="合同状态"
                                    width="150"
                                >
                                    <template slot-scope="{ row }">
                                        {{
                                            row.source == '1'
                                                ? '--'
                                                : options.stateArr[
                                                      row.contractState
                                                  ]
                                        }}
                                    </template>
                                </el-table-column>
                                <el-table-column
                                    prop="source"
                                    label="业绩来源"
                                    width="150"
                                >
                                    <template slot-scope="{ row }">
                                        {{ ['系统内', '系统外'][row.source] }}
                                    </template>
                                </el-table-column>
                            </el-table>
                        </div>
                    </div>
                    <!-- 企业主要管理人 -->
                    <div id="firmAdminCon" class="con">
                        <div class="tabs-title" id="firmAdmin">
                            企业主要管理人
                        </div>
                        <div class="e-table">
                            <div class="top">
                                <div class="left">
                                    <div>
                                        <el-button
                                            size="small"
                                            style="
                                                background: #7aa818;
                                                color: #fff;
                                            "
                                            @click="attachDownload('staffData')"
                                            >批量下载</el-button
                                        >
                                    </div>
                                </div>
                            </div>
                            <el-table
                                :data="staffData"
                                border
                                style="width: 100%"
                                ref="table"
                                class="table"
                                :max-height="$store.state.tableHeight"
                                @cell-mouse-enter="cellMouseEnter"
                                @cell-mouse-leave="cellMouseLeave"
                                @select="selectStaffData"
                                @select-all="selectStaffDataAll"
                                :cell-class-name="cellClsNm"
                                :header-cell-style="{ textAlign: 'center' }"
                                :cell-style="{ textAlign: 'center' }"
                                v-sortTable="{
                                    tableData: staffData,
                                    _this: this,
                                    ref: 'table'
                                }"
                            >
                                <el-table-column type="selection" width="55">
                                </el-table-column>
                                <el-table-column label="操作" width="55">
                                    <template slot-scope="{ row }">
                                        <img
                                            src="@/assets/btn/downLoad.png"
                                            @click="handleDownload(row, 3)"
                                            style="margin-right: 5px"
                                        />
                                    </template>
                                </el-table-column>
                                <el-table-column
                                    type="index"
                                    label="序号"
                                    width="100"
                                >
                                </el-table-column>
                                <el-table-column
                                    prop="personTypeKey"
                                    label="人员类别"
                                    width="160"
                                >
                                </el-table-column>
                                <el-table-column
                                    prop="staffName"
                                    label="姓名"
                                    width="100"
                                >
                                </el-table-column>
                                <el-table-column
                                    prop="idCard"
                                    label="身份证号码"
                                    width="200"
                                >
                                </el-table-column>
                                <el-table-column
                                    prop="tel"
                                    label="联系电话"
                                    width="150"
                                >
                                </el-table-column>
                                <el-table-column
                                    prop="certNo"
                                    label="证书及编号"
                                    width="150"
                                >
                                </el-table-column>
                                <el-table-column
                                    prop="beginDate"
                                    label="身份证有效开始日期"
                                    width="150"
                                >
                                </el-table-column>
                                <el-table-column
                                    prop="endDate"
                                    label="身份证有效结束日期"
                                    width="150"
                                >
                                </el-table-column>
                                <el-table-column
                                    prop="fileName"
                                    label="身份证附件"
                                    min-width="150"
                                >
                                    <template slot-scope="scope">
                                        <span
                                            @click="preview2(scope.row)"
                                            style="color: blue; cursor: pointer"
                                        >
                                            {{ scope.row.fileName }}
                                        </span>
                                    </template>
                                </el-table-column>
                            </el-table>
                        </div>
                    </div>
                    <!-- 附件信息 -->
                    <div id="accessoryCon" class="con">
                        <div class="tabs-title" id="accessory">附件信息</div>
                        <div class="e-table">
                            <div class="top">
                                <div>
                                    <el-button
                                        size="small"
                                        style="
                                            background: #7aa818;
                                            color: #fff;
                                            margin-left: 15px;
                                        "
                                        @click="
                                            attachDownload('enclosureTable')
                                        "
                                        >批量下载</el-button
                                    >
                                </div>
                            </div>
                            <el-table
                                :data="enclosureTable"
                                border
                                style="width: 100%"
                                ref="table"
                                class="table"
                                :max-height="$store.state.tableHeight"
                                @cell-mouse-enter="cellMouseEnter"
                                @cell-mouse-leave="cellMouseLeave"
                                @select="selectEnclosureTable"
                                @select-all="selectEnclosureTableAll"
                                :cell-class-name="cellClsNm"
                                :header-cell-style="{ textAlign: 'center' }"
                                :cell-style="{ textAlign: 'center' }"
                                v-sortTable="{
                                    tableData: enclosureTable,
                                    _this: this,
                                    ref: 'table'
                                }"
                            >
                                <el-table-column type="selection" width="55">
                                </el-table-column>
                                <el-table-column label="操作" width="55">
                                    <template slot-scope="{ row }">
                                        <img
                                            src="@/assets/btn/downLoad.png"
                                            @click="handleDownload(row, 4)"
                                            style="margin-right: 5px"
                                        />
                                    </template>
                                </el-table-column>
                                <el-table-column
                                    type="index"
                                    label="序号"
                                    width="100"
                                >
                                </el-table-column>
                                <el-table-column
                                    prop="fileTypeValue"
                                    label="类型"
                                    width="150"
                                >
                                </el-table-column>
                                <el-table-column
                                    prop="fileName"
                                    label="文件名称"
                                    mex-width="200"
                                >
                                    <template slot-scope="scope">
                                        <span
                                            @click="preview3(scope.row)"
                                            style="color: blue; cursor: pointer"
                                        >
                                            {{ scope.row.fileName }}
                                        </span>
                                    </template>
                                </el-table-column>
                                <el-table-column
                                    prop="fileSize"
                                    label="文件大小"
                                    width="100"
                                >
                                </el-table-column>
                                <el-table-column
                                    prop="gmtCreate"
                                    label="上传时间"
                                    width="200"
                                >
                                </el-table-column>
                                <el-table-column
                                    prop="fileUploaderName"
                                    label="上传人"
                                    width="100"
                                >
                                </el-table-column>
                            </el-table>
                        </div>
                    </div>
                    <!-- 审核历史 -->
                    <div v-if="isShow" id="auditHistoryCon" class="con">
                        <div class="tabs-title" id="auditHistory">审核历史</div>
                        <ComExaHistory
                            :billType="6040"
                            @getAuditHistory="getAuditHistory"
                            :tableData="tableData"
                            ref="ComExaHistory"
                        />
                    </div>
                    <!-- 变更历史 -->
                    <div id="alterationCon" class="con">
                        <div class="tabs-title" id="alteration">变更历史</div>
                        <div class="e-table">
                            <el-table
                                :data="alterationTable"
                                border
                                style="width: 100%"
                                ref="table"
                                class="table"
                                :max-height="$store.state.tableHeight"
                                @cell-mouse-enter="cellMouseEnter"
                                @cell-mouse-leave="cellMouseLeave"
                                :cell-class-name="cellClsNm"
                                :header-cell-style="{ textAlign: 'center' }"
                                :cell-style="{ textAlign: 'center' }"
                                v-sortTable="{
                                    tableData: alterationTable,
                                    _this: this,
                                    ref: 'table'
                                }"
                            >
                                <el-table-column
                                    prop="subcontractorName"
                                    label="工程分包商名称"
                                    width="200"
                                >
                                    <template slot-scope="scope">
                                        <span
                                            @click="Examine(scope.row)"
                                            style="color: blue; cursor: pointer"
                                        >
                                            {{ scope.row.subcontractorName }}
                                        </span>
                                    </template>
                                </el-table-column>
                                <el-table-column
                                    prop="registerCapital"
                                    label="注册资本（万元）"
                                    width="200"
                                >
                                </el-table-column>
                                <el-table-column
                                    prop="creditCode"
                                    label="统一社会信用代码"
                                    width="200"
                                >
                                </el-table-column>
                                <el-table-column
                                    prop="manageOrgName"
                                    label="管理单位"
                                    width="200"
                                >
                                </el-table-column>
                                <el-table-column
                                    prop="businessScopeName"
                                    label="主营范围"
                                    width="200"
                                >
                                </el-table-column>
                                <el-table-column
                                    prop="qualificationLevelName"
                                    label="资质等级"
                                    width="200"
                                >
                                </el-table-column>
                                <el-table-column
                                    prop="billDate"
                                    label="变更时间"
                                    width="200"
                                >
                                </el-table-column>
                                <el-table-column
                                    prop="founderName"
                                    label="变更人"
                                    width="200"
                                >
                                </el-table-column>
                                <el-table-column
                                    prop="state"
                                    label="变更状态"
                                    width="200"
                                >
                                    <template slot-scope="scope">
                                        {{ statusLable(scope.row.state) }}
                                    </template>
                                </el-table-column>
                            </el-table>
                        </div>
                    </div>
                    <!-- 评价历史 -->
                    <div id="evaluateCon" class="con">
                        <div class="tabs-title" id="evaluate">评价历史</div>
                        <div class="e-table">
                            <el-table
                                :data="auditHistoryTable"
                                border
                                style="width: 100%"
                                ref="table"
                                class="table"
                                :max-height="$store.state.tableHeight"
                                @cell-mouse-enter="cellMouseEnter"
                                @cell-mouse-leave="cellMouseLeave"
                                :cell-class-name="cellClsNm"
                                v-sortTable="{
                                    tableData: auditHistoryTable,
                                    _this: this,
                                    ref: 'table'
                                }"
                            >
                                <el-table-column
                                    prop="orgName"
                                    label="评价机构"
                                    width="200"
                                >
                                </el-table-column>
                                <el-table-column
                                    prop="billDate"
                                    label="评价时间"
                                    width="200"
                                >
                                </el-table-column>
                                <el-table-column
                                    prop="evaluate"
                                    label="评价结论"
                                    width="200"
                                >
                                </el-table-column>
                                <el-table-column
                                    prop="starDate"
                                    label="开始时间"
                                    width="200"
                                >
                                </el-table-column>
                                <el-table-column
                                    prop="endDate"
                                    label="结束时间"
                                    width="200"
                                >
                                </el-table-column>
                                <el-table-column
                                    prop="type"
                                    label="评价来源"
                                    min-width="200"
                                >
                                </el-table-column>
                            </el-table>
                        </div>
                    </div>
                </div>
            </el-tabs>
        </div>
        <div id="seat" :style="{ height: seatHeight + 'px' }"></div>
        <div v-if="!isview" class="buttons">
            <el-button
                type="primary"
                v-if="basicFormData.state == 2"
                @click="chengeBtn"
                size="small"
                >变更</el-button
            >
            <ComExaButtons
                v-if="basicFormData.state != 5"
                :auditState="auditState"
                :state="basicFormData.state"
                :founderId="basicFormData.founderId"
                @exas="exas"
            />
            <el-button size="small" @click="handleClose">取消</el-button>
        </div>
    </div>
</template>

<script>
import {
    performanceList,
    staffList,
    qualificationList,
    getEvaluateList
} from '@/api/OutsourcingartyAdmin/subcontractorAdmin/subcontractor.js'
import subcontractorChange from '@/api/OutsourcingartyAdmin/subcontractorAdmin/subcontractorChange.js'
import examine from '@/api/OutsourcingartyAdmin/subcontractorAdmin/examine.js'
import ossRequest from '@/api/oss/oss.js'
import {
    showSuccessPop,
    openAppClient,
    throttle,
    showLoading,
    hideLoading,
    batchDownload
} from '@/utils/common'
import service from '@/utils/request'
import ComExaButtons from '@/components/common/exaButtons'
//审核历史
import ComExaHistory from '@/components/common/exaHistory.vue'
// 分包商
import { toVoid } from '@/api/OutsourcingartyAdmin/subcontractorAdmin/subcontractor.js'
import call from '@/api/OutsourcingartyAdmin/getAllType.js'
import '@/utils/jquery.scrollTo.min'
import { mapState } from 'vuex'

export default {
    components: {
        ComExaButtons,
        ComExaHistory
    },
    data () {
        return {
            tabsName: 'baseInfo',
            form: {
                name: '',
                region: '',
                date1: '',
                date2: '',
                delivery: false,
                type: [],
                resource: '',
                desc: ''
            },
            tableData: [],
            value: '',
            textarea: '',
            screenWidth: 0,
            screenHeight: 0,
            lastConHeight: 0,
            clickTabFlag: false, // 如果手动点击时，则不做滚动事件逻辑，只有滚动屏幕时才走滚动事件逻辑
            //基本信息表单数据
            basicFormData: {
                creditCode: '', //统一社会信用代码
                subcontractorName: '', //分包商名称
                type: '', //类型
                deputy: '', //法人代表
                registerAddProvince: '', //注册地址省
                registerAddCity: '', //注册地址市
                registerAddDistrict: '', //注册地址先去
                registerAddInfo: '', //注册地址详细
                contactTel: '', //联系电话
                registerCapital: '', //注册资本
                fax: '', //传真
                email: '', //邮箱
                taxType: '', //纳税类别
                postCode: '', //邮编
                manageOrgName: '', //管理单位
                isAbroadUnit: '', //是否为境外单位
                creditLevelName: '', //信用等级
                state: 0, //状态
                fixedAddProvince: '', //固定地址省
                fixedAddCity: '', //固定地址市
                fixedAddDistrict: '', //固定地址县区
                fixedAddInfo: '', //固定地址详细
                basicInfo: '', //企业基本情况
                registeredConstructorQty: '', //企业注册建造师数量
                aboveTitleQty: '', //中级及以上职称人员数量
                certificateQty: '', //持有岗位证书的施工现场管理人员数量
                safetyCertificateQty: '', //持有安全C证人员数量
                paySocialSecurityQty: '', //正常缴纳社保人数
                passedTrainingQty: '', //经考级或培训合格的中级工以上技术工人数量
                address: '', //地址
                addressCode: '', //地址编码 以逗号分割
                addressDetail: '', //详细地址
                billDate: '', //单据时间
                businessScopeId: '', //主营范围ID
                businessScopeName: '', //主营范围
                changeState: '', //	变更状态
                contactName: '', //联系人
                creditLevel: 0, //	信用等级(数据字典)
                fixAddress: '', //固定地址
                fixAddressCode: '', //固定地址(地址编码)
                fixAddressDetail: '', //固定地址(详细)
                founderId: '', //录入人Id
                founderName: '', //	录入人
                id: '', //唯一ID
                isQualified: 0, //	是否合格(0不合格，1合格，2黑名单)
                manageOrgId: '', //	管理单位ID
                orgId: '', //机构
                orgName: '', //机构名称
                projectLeader: '', //项目负责人
                qualificationLevelId: '', //资质等级ID
                qualificationLevelName: '', //资质等级
                remark: '', //备注
                source: 0, //来源(0内部录入 1招标)
                subcontractorNo: '', //	分包商编号
                subcontractorTypeKey: '', //分包商类型(枚举key) 逗号分割
                subcontractorTypeValue: '', //分包商类型(枚举值) 逗号分割
                taxTypeKey: '', //	纳税类别(数据字典)
                taxTypeValue: '', //纳税类别(数据字典)
                workAdd: '' //固定工作地址
            },
            billid: '', //单据id
            aptitudeTable: [], //资质信息
            performanceData: [], //主要业绩
            staffData: [], //主要管理人
            enclosureTable: [], //附件
            fileType: [], //附件类型
            alterationTable: [], //变更历史
            auditHistoryTable: [], //评价历史
            auditState: {}, //按钮状态
            winEvent: {}, //保存事件，跳转页面的时候，结束事件，优化性能
            isview: false, //是否展示按钮组件
            creditCode: '', //信用代码【通过信用代码查详情】
            isShow: false, //【用来控制奖惩查看的时候，初始化不渲染审核历史，拿到id再渲染】
            viewId: '', //【保存奖惩查看页面取回来的id】
            expirationPrompt: [], //到期提醒
            selectionAptitudeTable: [], //资质信息选中数据
            selectionperformanceData: [], //企业主要业绩选中数据
            selectionStaffData: [], //企业主要管理人选中数据
            selectionEnclosureTable: [] //附件信息选中数据
        }
    },
    computed: {
        // 填补底部空白，以使高度够滚动
        ...mapState({
            options: state => state.contract.ctClassify
        }),
        seatHeight () {
            return this.screenHeight - 72 - this.lastConHeight
        },
        // 判断状态
        statusLable () {
            return param => {
                const state = this.$store.state.equip.equipData.state
                const obj = state.find(x => x.value == param)
                if (obj !== undefined) {
                    return obj.label
                }
            }
        },
        showAddress () {
            return value => {
                if (!value) return ''
                try {
                    let obj = JSON.parse(value)
                    const address = obj.address ? obj.address.join('-') : ''
                    const detail = obj.detail
                    let str = ''
                    if (address && detail) {
                        str = address + '-' + detail
                    } else if (!address && detail) {
                        str = detail
                    } else if (address && !detail) {
                        str = address
                    }
                    return str
                } catch (err) {
                    return value
                }
            }
        }
    },
    created () {
        this.billid = this.$route.query.billid
        this.isview = this.$route.query.isview
        this.creditCode = this.$route.query.creditCode
        //获取类型
        call.getCredential('附件类型').then(res => {
            this.fileType = res
        })
        this.getBasicData() //进入页面就获取基本信息数据
        if (this.billid) {
            this.qualificationList(this.billid) //初始化资质信息列表
            this.performanceList(this.billid) //初始化企业主要业绩
            this.staffList(this.billid) //主营业绩
            this.getObjectByRelationId(this.billid) //附件
            this.getList(this.billid) //变更历史
            this.getevaluateList(this.billid) //评价历史
            this.getCurrentUnitInfo() //获取流程按钮
            this.isShow = true
        }
    },
    mounted () {
        // 获取最后一个内容区域的高度，计算底部空白
        this.getLastConHeight()

        // 保存所有tabName
        const arr = [
            'baseInfo',
            'aptitude',
            'firmPerformance',
            'firmAdmin',
            'accessory',
            'auditHistory',
            'alteration',
            'evaluate'
        ]
        let $idsTop = []
        const onScroll = () => {
            // 如果手动点击时，则不做滚动事件逻辑，只有滚动屏幕时才走滚动事件逻辑
            if (this.clickTabFlag) {
                return
            }
            if (!$idsTop[$idsTop.length - 1]) {
                $idsTop = arr.map(item => {
                    const $item = document.getElementById(item)
                    let itemTop = null
                    if ($item) {
                        itemTop = $item.offsetTop
                    }
                    return itemTop
                })
            }
            const scrollTop =
                document.documentElement.scrollTop || document.body.scrollTop
            // 倒序查找
            let curLocal = 0
            for (let len = $idsTop.length, i = len - 1; i >= 0; i--) {
                let item = $idsTop[i]
                if (scrollTop + 1 >= item) {
                    curLocal = i
                    break
                }
            }
            // 设置对应tabName
            this.tabsName = arr[curLocal]
        }
        this.winEvent.onScroll = onScroll
        window.addEventListener('scroll', this.winEvent.onScroll)
        this.screenWidth =
            document.documentElement.clientWidth - this.topHeight
        this.screenHeight =
            document.documentElement.clientHeight - this.topHeight
        const onResize = () => {
            this.screenWidth =
                document.documentElement.clientWidth - this.topHeight
            this.screenHeight =
                document.documentElement.clientHeight - this.topHeight
            $idsTop = arr.map(item => {
                const itemTop = document.getElementById(item).offsetTop
                return itemTop
            })
        }
        this.winEvent.onResize = throttle(onResize, 500)
        window.addEventListener('resize', this.winEvent.onResize)
    },
    beforeDestroy () {
        window.removeEventListener('scroll', this.winEvent.onScroll)
        window.removeEventListener('resize', this.winEvent.onResize)
    },
    methods: {
        //获取基本信息数据
        getBasicData () {
            this.$Ajax
                .httpGet({
                    url: this.creditCode
                        ? '/outer/subcontractor/findbycreditcode'
                        : '/outer/subcontractor/findById',
                    params: this.creditCode
                        ? { creditCode: this.creditCode, hasDtls: false }
                        : {
                            id: this.billid
                        },
                    headers: {
                        'Content-Type': 'application/x-www-form-urlencoded'
                    }
                })
                .then(res => {
                    this.basicFormData = res
                    this.basicFormData.type = res.subcontractorTypeKey
                    this.basicFormData.taxType = res.taxTypeKey
                    //处理注册地址
                    let data = JSON.parse(res.addressDetail).address.join('')
                    let data1 = JSON.parse(res.addressDetail).detail
                    this.basicFormData.addressDetail = data + data1
                    //处理固定地址
                    let data2 = JSON.parse(res.fixAddressDetail).address.join(
                        ''
                    )
                    let data3 = JSON.parse(res.fixAddressDetail).detail
                    this.basicFormData.fixAddressDetail = data2 + data3
                    // 如果传的是信用代码，则等待基础数据回来之后再调审核历史
                    if (this.creditCode) {
                        this.qualificationList(res.id) //初始化资质信息列表
                        this.performanceList(res.id) //初始化企业主要业绩
                        this.staffList(res.id) //主营业绩
                        this.getObjectByRelationId(res.id) //附件
                        this.getList(res.id) //变更历史
                        this.getevaluateList(res.id) //评价历史
                        if (res.id) {
                            this.isShow = true
                            this.viewId = res.id
                        }
                    }
                })
        },
        // 获取最后一个内容区域的高度，计算底部空白
        getLastConHeight () {
            let si = setInterval(() => {
                // 因为dom异步加载，通过轮询找到渲染后的dom，获取高度
                if (document.getElementById('evaluateCon')) {
                    const lastConHeight =
                        document.getElementById('evaluateCon').offsetHeight
                    console.log('lastConHeight: ', lastConHeight)
                    this.lastConHeight = lastConHeight
                    console.log('this.lastConHeight', this.lastConHeight)
                    clearInterval(si)
                    si = null
                }
            }, 100)
        },
        //删除
        delData () {
            this.$Ajax
                .httpGet({
                    url: '/outer/subcontractor/delete',
                    params: {
                        id: this.id
                    },
                    headers: {
                        'Content-Type': 'application/x-www-form-urlencoded'
                    }
                })
                .then(res => {
                    this.$message({
                        showClose: true,
                        type: 'success',
                        message: res.message
                    })
                    this.$router.push('./subcontractorWarehouse')
                })
        },
        handleFullScreen () {
            this.fullscreen = !this.fullscreen
        },
        //取消
        handleClose () {
            this.dialogVisible = false
            this.$router.push('./subcontractorWarehouse')
        },
        cellClsNm ({ column }) {
            if (column.label === '') {
                return 'fixed-left'
            }
        },
        cellMouseEnter (row) {
            this.MouseEnterId = row.id
        },
        cellMouseLeave () {
            this.MouseEnterId = 0
        },
        onChangeTab (e) {
            const height = $('#' + e.name).offset().top
            $.scrollTo(height - this.topHeight, 500)
            // 如果手动点击时，则不做滚动事件逻辑，只有滚动屏幕时才走滚动事件逻辑
            this.clickTabFlag = true
            // 动画结束后，恢复状态
            setTimeout(() => {
                this.clickTabFlag = false
            }, 600)
        },
        // 资质信息列表
        async qualificationList (val) {
            let data = await qualificationList(val)
            data.map(item => {
                if (new Date(item.endDate).getFullYear() == 9999) {
                    item.endDate = '永久'
                }
                if (item.isOverdue == '1') {
                    this.expirationPrompt.push(
                        `${item.certTypeValue}将要到期了，到期日期是${item.endDate}，为了不影响后续业务，请及时更新资质信息！`
                    )
                } else if (item.isOverdue == '2') {
                    this.expirationPrompt.push(
                        `${item.certTypeValue}已经到期了，到期日期是${item.endDate}，为了不影响后续业务，请及时更新资质信息！`
                    )
                }
            })
            this.aptitudeTable = data
        },
        // 主要业绩
        async performanceList (val) {
            let data = await performanceList({ billId: val, keyword: '' })
            if (data.length > 0) {
                this.performanceData = data
            }
        },
        // 主要管理人
        async staffList (val) {
            let data = await staffList(val)
            if (data.length > 0) {
                this.staffData = data
            }
        },
        // 附件
        getObjectByRelationId (val) {
            return ossRequest
                .getObjectByRelationId({ relationId: val })
                .then(res => {
                    if (res.length > 0) {
                        res.map(item => {
                            item.fileName = item.objectName
                            item.fileSize = item.objectSize
                            item.fileUploaderName = item.ossBucketName
                            this.fileType.map(newItem => {
                                if (item.relationIdTag == newItem.kvValue) {
                                    item.fileTypeValue = newItem.kvKey
                                }
                            })
                        })
                        this.enclosureTable = res
                    }
                })
        },
        // 变更历史列表查询
        async getList (val) {
            let data = await subcontractorChange.findByIdChangehistorList({
                id: val
            })
            this.alterationTable = data
        },
        // 评价历史
        async getevaluateList (val) {
            let data = await getEvaluateList({ id: val })
            this.auditHistoryTable = data
        },
        //变更按钮
        chengeBtn () {
            let billid = this.basicFormData.id
            this.$router.push({
                path: '/subcontractorChangeAdd',
                query: { billid }
            })
        },
        //点击表格查看
        Examine (row) {
            //点击进入查看页面
            const billid = row.id
            if (row.state === -1 || row.state === 2 || row.state === 5) {
                this.$router.push({
                    path: '/subcontractorChangeShow',
                    query: { billid }
                })
            } else {
                // 根据按钮状态来判断点击编辑进什么页面
                examine
                    .getCurrentUnitInfo({
                        billId: billid,
                        billType: 60401,
                        freeNextUnitIndex: 0,
                        freeNextUser: '',
                        isPass: true,
                        isShareInAudit: true,
                        opinion: ''
                    })
                    .then(res => {
                        this.auditState = res
                        if (this.auditState.canModify) {
                            this.$router.push({
                                path: '/subcontractorChangeEdit',
                                query: { billid }
                            })
                        } else {
                            this.$router.push({
                                path: '/subcontractorChangeShow',
                                query: { billid }
                            })
                        }
                    })
            }
        },
        //预览附件
        preview (val) {
            this.aptitudeTable.some(item => {
                if (item.id == val.id) {
                    window.open(item.dialogImage)
                }
            })
        },
        //企业主要业绩预览附件
        preview1 (val) {
            this.performanceData.some(item => {
                if (item.id == val.id) {
                    window.open(item.dialogImage)
                }
            })
        },
        //企业主要管理人预览附件
        preview2 (val) {
            this.staffData.some(item => {
                if (item.id == val.id) {
                    window.open(item.dialogImage)
                }
            })
        },
        //附件预览附件
        preview3 (val) {
            this.enclosureTable.some(item => {
                if (item.id == val.id) {
                    window.open(item.dialogImage)
                }
            })
        },
        audit () {
            // 客户端弹窗弹出本地页面
            openAppClient('/exaDialog', '填写审核意见', () => {
                // 审核拿到审核弹窗的意见
                const auditParams = JSON.parse(localStorage.vuex).auditParams
                // 将审核意见赋值给参数传给后端
                examine
                    .audit({
                        billId: this.$route.query.billid,
                        billType: 6040,
                        freeNextUnitIndex: 0,
                        freeNextUser: '',
                        isPass: auditParams.isPass,
                        isShareInAudit: true,
                        opinion: auditParams.opinion
                    })
                    .then(() => {
                        this.clientPop('suc', '审核成功')
                        // 保存成功置空数据
                        this.firmAdminTable = []
                        this.firmPerformanceTable = []
                        this.aptitudeTable = []
                        this.attachTable = []
                        // 返回列表
                        this.handleClose()
                    })
            }, null, null, null, 'small')
        },
        // 删除方法
        ctDelete () {
            this.clientPop('info', this.oneDeleteErr, this.delent)
        },
        //删除回调
        delent () {
            this.$Ajax
                .httpGet({
                    url: '/outer/subcontractor/delete',
                    params: {
                        id: this.billid
                    },
                    headers: {
                        'Content-Type': 'application/x-www-form-urlencoded'
                    }
                })
                .then(res => {
                    if (res.code == 200) {
                        showSuccessPop('删除成功！')
                        this.isSkip = true
                    }
                    this.$router.push('./subcontractorWarehouse')
                })
        },
        // 作废
        toVoidChange () {
            this.clientPop('info', '是否确认作废', this.callback)
        },
        // 作废确认回调
        async callback () {
            // 客户端弹窗弹出本地页面
            const auditParams = JSON.parse(localStorage.vuex).auditParams
            openAppClient('/nullifyDialog', '单据作废原因', async () => {
                showLoading()
                await toVoid({
                    billId: this.billid, //单据id
                    billType: '6040', //单据类型
                    nullifyCreated: '',
                    nullifyCreator: '',
                    nullifyCreatorId: '',
                    nullifyDescription: auditParams.nullifyDescription,
                    nullifyReason: auditParams.nullifyReason
                }).catch(() => {
                    this.clientPop('suc', '作废失败')
                })
                hideLoading()
            })
        },
        // 撤回
        withdrawChange () {
            this.clientPop('info', '是否确认撤回', this.callbackWithdraw)
        },
        // 撤回确认回调
        async callbackWithdraw () {
            let { code } = await examine.undoAudit({
                billId: this.billid, //单据id
                billType: '6040', //单据类型
                freeNextUnitIndex: 0,
                freeNextUser: '',
                isPass: true,
                isShareInAudit: true,
                opinion: ''
            })
            if (code == 200) {
                showSuccessPop('撤回成功')
                // 返回列表
                this.handleClose()
            } else {
                showSuccessPop('撤回失败')
            }
        },
        // 审核历史列表查询
        async getAuditHistory () {
            let data = await subcontractorChange.findByIdAuditHistory({
                billId: this.viewId || this.billid,
                billType: 6040,
                freeNextUnitIndex: 0,
                freeNextUser: '',
                isPass: true,
                isShareInAudit: true,
                opinion: ''
            })
            this.tableData = data
        },
        // 获取按钮状态
        getCurrentUnitInfo () {
            examine
                .getCurrentUnitInfo({
                    billId: this.billid,
                    billType: 6040,
                    freeNextUnitIndex: 0,
                    freeNextUser: '',
                    isPass: true,
                    isShareInAudit: true,
                    opinion: ''
                })
                .then(res => {
                    this.auditState = res
                })
        },
        //下载某一行
        async handleDownload (obj, number) {
            let url = ''
            let fileNameFull = ''
            if (number === 4) {
                url = obj.objectPath
                fileNameFull = obj.objectName
            } else {
                url = obj.dialogImage
                fileNameFull = obj.fileName
            }
            showLoading()
            const fileExt = fileNameFull.split('.').pop()
            if (
                ['jpg', 'jpeg', 'gif', 'png', 'bmp'].indexOf(
                    fileExt.toLowerCase()
                ) === -1
            ) {
                const { httpGetFile } = service
                const data = await httpGetFile({ url })
                const blob = new Blob([data])
                const reader = new FileReader()
                reader.readAsDataURL(blob)
                reader.onload = function (e) {
                    this.autoClick({
                        fileName: fileNameFull,
                        url: e.target.result
                    })
                }.bind(this)
            } else {
                this.downloadIamge(url, fileNameFull)
            }
            hideLoading()
        },
        downloadIamge (imgsrc, fileName) {
            //下载图片地址和图片名
            var image = new Image()
            // 解决跨域 Canvas 污染问题
            image.setAttribute('crossOrigin', 'anonymous')
            image.onload = function () {
                const canvas = document.createElement('canvas')
                canvas.width = image.width
                canvas.height = image.height
                const context = canvas.getContext('2d')
                context.drawImage(image, 0, 0, image.width, image.height)
                const _dataURL = canvas.toDataURL('image/png') //得到图片的base64编码数据

                const blob_ = this.dataURLtoBlob(_dataURL) // 用到Blob是因为图片文件过大时，在一部风浏览器上会下载失败，而Blob就不会

                const url = {
                    name: fileName || '图片.png', // 图片名称不需要加.png后缀名
                    src: blob_
                }

                if (window.navigator.msSaveOrOpenBlob) {
                    // if browser is IE
                    navigator.msSaveBlob(url.src, url.name) //filename文件名包括扩展名，下载路径为浏览器默认路径
                } else {
                    this.autoClick({
                        fileName: url.name,
                        url: window.URL.createObjectURL(url.src)
                    })
                }
            }.bind(this)
            image.src = imgsrc
        },
        dataURLtoBlob (dataurl) {
            var arr = dataurl.split(','),
                mime = arr[0].match(/:(.*?);/)[1],
                bstr = window.atob(arr[1]),
                n = bstr.length,
                u8arr = new Uint8Array(n)
            while (n--) {
                u8arr[n] = bstr.charCodeAt(n)
            }
            return new Blob([u8arr], { type: mime })
        },
        autoClick ({ fileName, url }) {
            const elink = document.createElement('a')
            elink.download = fileName
            elink.style.display = 'none'
            elink.href = url
            document.body.appendChild(elink)
            elink.click()
            document.body.removeChild(elink)
        },
        // 资质信息批量下载选中数据
        selectAptitudeTable (selection) {
            this.selectionAptitudeTable = selection
        },
        // 资质全选按钮
        selectAptitudeTableAll (selection) {
            this.selectionAptitudeTable = selection
        },
        // 企业主要业绩批量下载选中数据
        selectPerformanceData (selection) {
            this.selectionperformanceData = selection
        },
        // 企业主要业绩批量下载全选
        selectPerformanceDataAll (selection) {
            this.selectionperformanceData = selection
        },
        // 企业主要管理人批量下载选中数据
        selectStaffData (selection) {
            this.selectionStaffData = selection
        },
        // 企业主要管理人批量下载全选
        selectStaffDataAll (selection) {
            this.selectionStaffData = selection
        },
        // 附件信息批量下载选中数据
        selectEnclosureTable (selection) {
            this.selectionEnclosureTable = selection
        },
        // 附件信息批量下载全选
        selectEnclosureTableAll (selection) {
            this.selectionEnclosureTable = selection
        },
        attachDownload (val) {
            let fileList = {}
            // 资质信息
            if (val == 'aptitudeTable') {
                fileList = this.selectionAptitudeTable.map(item => {
                    return {
                        objectName: item.fileName, //文件名
                        objectPath: item.dialogImage //文件地址
                    }
                })
                //主要业绩
            } else if (val == 'performanceData') {
                fileList = this.selectionperformanceData.map(item => {
                    return {
                        objectName: item.fileName, //文件名
                        objectPath: item.dialogImage //文件地址
                    }
                })
                // 主要管理人
            } else if (val == 'staffData') {
                fileList = this.selectionStaffData.map(item => {
                    return {
                        objectName: item.fileName, //文件名
                        objectPath: item.dialogImage //文件地址
                    }
                })
                // 附件信息
            } else {
                fileList = this.selectionEnclosureTable.map(item => {
                    return {
                        objectName: item.objectName, //文件名
                        objectPath: item.objectPath //文件地址
                    }
                })
            }
            batchDownload(fileList)
        },
        // 按钮组件触发事件
        exas (data) {
            switch (data) {
            case 'audit':
                this.audit() //审核
                break
            case 'undoAudit':
                this.withdrawChange() //撤回
                break
            case 'submitCommit':
                this.submit() //提交
                break
            case 'submit':
                this.save() //保存
                break
            case 'nullify':
                this.toVoidChange() //作废
                break
            case 'deleteData':
                this.ctDelete() //删除
                break
            default:
                break
            }
        }
    }
}
</script>

<style lang="scss" scoped>
.buttons {
    left: 0;
}
.e-form {
    margin-bottom: 80px;
    padding: 0 20px;
    .tabs-title::before {
        content: '';
        height: 22px;
        width: 8px;
        border-radius: 40px;
        background-color: #2e61d7;
        display: block;
        position: absolute;
        left: 20px;
        margin-right: 20px;
    }
}

.e-table {
    background: #fff;
}
// ::v-deep.el-table__body-wrapper::-webkit-scrollbar{
//      width: 6px !important; // 横向滚动条
//     height: 10px !important// 纵向滚动条
// }

::v-deep .el-table__body-wrapper::-webkit-scrollbar {
    width: 6px; // 横向滚动条
    height: 10px; // 纵向滚动条
}
// 滚动条的滑块
::v-deep .el-table__body-wrapper::-webkit-scrollbar-thumb {
    background-color: #ddd;
    border-radius: 5px;
}

.el-tab-pane {
    margin-left: -10px;
}
::v-deep.el-upload-dragger {
    height: 90px;
    margin-left: 300px;
}
</style>
